package com.jstyle.jclife.utils;

import com.jstyle.jclife.model.HealthData;

import java.util.Comparator;

/**
 * Created by Administrator on 2019/1/7.
 */

public class BloodMaxComparator implements Comparator<HealthData> {

    @Override
    public int compare(HealthData o1, HealthData o2) {
        if(o1.getHighBloodPressure()-o2.getHighBloodPressure()>0){
            return 1;
        }else if(o1.getHighBloodPressure()-o2.getHighBloodPressure()==0){
            return o1.getLowBloodPressure()-o2.getLowBloodPressure();
        }else{
            return -1;
        }
    }
}
